import time

from selenium.webdriver.common.by import By


class FundsOperation:
    #查看卡数
    def jijinlingqian(self,driver,username,password,pay_password):
        driver.find_element(By.ID, 'username').send_keys(username)
        time.sleep(1)
        driver.find_element(By.ID, 'password').send_keys(password)
        time.sleep(1)
        driver.find_element(By.ID, 'login_btn').click()
        time.sleep(1)
        driver.find_element(By.XPATH, '//*[@id="leftbaraside"]/div[2]/nav/ul/li[2]/a').click()
        time.sleep(1)
        driver.find_element(By.XPATH, '//*[@id="leftbaraside"]/div[2]/nav/ul/li[2]/ul/li[1]/a').click()
        time.sleep(1)
        driver.find_element(By.XPATH,
                            '/html/body/div/div/main/div/div/div/div/div[2]/div/table/tbody/tr[1]/td[6]/button').click()
        time.sleep(1)
        driver.find_element(By.XPATH, '//*[@id="layui-layer1"]/div[2]/input').send_keys(pay_password)
        time.sleep(1)
        driver.find_element(By.XPATH, '//*[@id="layui-layer1"]/div[3]/a[1]').click()
        time.sleep(1)

    def jijinqixian(self,driver,username,password,pay_password):
        driver.find_element(By.ID, 'username').send_keys(username)
        time.sleep(1)
        driver.find_element(By.ID, 'password').send_keys(password)
        time.sleep(1)
        driver.find_element(By.ID, 'login_btn').click()
        time.sleep(1)
        driver.find_element(By.XPATH, '//*[@id="leftbaraside"]/div[2]/nav/ul/li[2]/a').click()
        time.sleep(1)
        driver.find_element(By.XPATH, '//*[@id="leftbaraside"]/div[2]/nav/ul/li[2]/ul/li[2]/a').click()
        time.sleep(1)
        driver.find_element(By.XPATH,
                            '/html/body/div/div/main/div/div/div/div/div[2]/div/table/tbody/tr[1]/td[8]/button').click()
        time.sleep(1)
        driver.find_element(By.XPATH, '//*[@id="layui-layer1"]/div[2]/input').send_keys(pay_password)
        time.sleep(1)
        driver.find_element(By.XPATH, '//*[@id="layui-layer1"]/div[3]/a[1]').click()
        time.sleep(1)

    def jijinjijin(self, driver, username, password, pay_password):
        driver.find_element(By.ID, 'username').send_keys(username)
        time.sleep(1)
        driver.find_element(By.ID, 'password').send_keys(password)
        time.sleep(1)
        driver.find_element(By.ID, 'login_btn').click()
        time.sleep(1)
        driver.find_element(By.XPATH, '//*[@id="leftbaraside"]/div[2]/nav/ul/li[2]/a').click()
        time.sleep(1)
        driver.find_element(By.XPATH, '//*[@id="leftbaraside"]/div[2]/nav/ul/li[2]/ul/li[3]/a').click()
        time.sleep(1)
        driver.find_element(By.XPATH,
                            '/html/body/div/div/main/div/div/div/div/div[2]/div/table/tbody/tr[1]/td[9]/button').click()
        time.sleep(1)
        driver.find_element(By.XPATH, '//*[@id="layui-layer1"]/div[2]/input').send_keys(pay_password)
        time.sleep(1)
        driver.find_element(By.XPATH, '//*[@id="layui-layer1"]/div[3]/a[1]').click()
        time.sleep(1)